/**存放所有导演模块相关接口 */

import myaxios from '../Myaxios'
import URLENV from '@/http/BaseUrl'
const BMDURL = URLENV.BMDURL
const DirectorApi = {
  /**
   * 删除导演接口
   * @param{Object} params
   * 参数列表: {id}
   */
  del(params) {
    let url = BMDURL + '/movie-director/del'
    return myaxios.post(url, params)
  },
  /**
   * 新增导演接口
   * @param{Object} params
   * 参数列表: {director_name:姓名,director_avatar:头像路径}
   */
  add(params) {
    let url = BMDURL + '/movie-director/add'
    return myaxios.post(url, params)
  },
  /**
   * 通过姓名关键字查询导演列表
   * @param{Object} params 参数列表： {name:'关键字'}
   */
  queryDirectorsByNameLike(params) {
    let url = BMDURL + '/movie-directors/name'
    return myaxios.post(url, params)
  },
  /**查询所有导演 */
  queryAllDirectors() {
    let url = BMDURL + '/movie-directors'
    let params = { page: 1, pagesize: 100 }
    return myaxios.get(url, params)
  },
}
export default DirectorApi
